<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" type="text/css" href="/static/css/hw-admin.css">

    <link rel="stylesheet" href="/static/css/lb.css"> 
    <style>
        #table-form td,th{
            text-align: center;
            word-break: break-all;
        }
        th,td,.name {
            text-align: center !important;
        }
    </style>
   	<!--[if lt IE 9]>
    　 <script src="https://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
       <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.js"></script>
    <![endif]-->
</head>
<body>

	<div class="hw-iframe">
		<!-- 顶部标题 -->
        <div class="hw-header-wrapper">
            <div class="hw-header">
                <div class="hw-header__item--left">
                    会员信息
                </div>
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">账号信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;"> 
                <table class="info-table"  border="0">  
                    <colgroup>
                        <col class="col-5"> 
                        <col class="col-15">
                        <col class="col-5"> 
                        <col class="col-15">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td class="name">账号状态</td>
                            <td><?=$member['state'] == 3 ? '已认证' : ($member['state'] == 2 ? '未认证' : '已授权') ?></td>
                            <td class="name">来源</td>
                            <td><?=!empty($member['hotel_code']) ? $member['hotel_name'] : '通用二维码' ?></td>
                        </tr>

                        <tr>
                            <td class="name">手机号</td>
                            <td><?=$this->unlock($member['phone']) ?></td>
                            <td class="name">注册时间</td>
                            <td><?=$member['create_time'] ?></td>
                        </tr>

                        <tr>
                            <td class="name">身份证</td>
                            <td><?=!empty($member['idNumber']) ? substr_replace($this->unlock($member['idNumber']), '******', 6, 8) : '' ?></td>
                            <td class="name">认证时间</td>
                            <td><?=$member['auth_time'] ?></td>
                        </tr>
                        <tr>
                            <td class="name">微信头像</td>
                            <td><img onclick="createPreviewModal('<?= $member['headimgurl'] ?>')" src="<?=isset($member['headimgurl']) ? $member['headimgurl'] : '' ?>" alt=""></td>
                            <td class="name">昵称</td>
                            <td><?=$member['nickname'] ?></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">身份信息</div>
            <div class="main-table-wrap" style="margin-top: 20px;"> 
                <table class="info-table"  border="0">  
                    <colgroup>
                        <col class="col-5"> 
                        <col class="col-15">
                        <col class="col-5"> 
                        <col class="col-15">
                    </colgroup>
                    <tbody>
                        <tr>
                            <td class="name">证件照片</td>
                            <td><img onclick="createPreviewModal('<?=$member['card_img'] ?>')" src="<?=$member['card_img'] ?>" alt=""></td>
                            <td class="name">姓名</td>
                            <td><?=$member['name'] ?></td>
                        </tr>

                        <tr>
                            <td class="name">性别</td>
                            <td><?=$member['gender'] == 'male' ? '男' : ($member['gender'] == 'famale' ? '女' : '未知') ?></td>
                            <td class="name">年龄</td>
                            <td><?=empty($member['birthDate']) ? '' : date('Y') - date('Y', strtotime($member['birthDate'])) ?></td>
                        </tr>
                        <tr>
                            <td class="name">民族</td>
                            <td><?=$member['nation'] ?></td>
                            <td class="name">地区</td>
                            <td><?=$member['address'] ?></td>
                        </tr>
                    </tbody>
                </table> 
            </div>
        </div>
        <div class="hw-group">
            <div class="group-title">申诉记录<span style="float: right;color:#2496EC;margin-right: 25px;"></span></div>
            <div class="main-table-wrap" style="margin-top: 20px;">
                <form id="table-form" method="POST" action="">
                    <table cellspacing="0" cellpadding="0" border="0">  
                        <colgroup>
                            <col class="col-3">
                            <col class="col-8">
                            <col class="col-8">
                            <col class="col-7">
                            <col class="col-5">
                            <col class="col-4">
                            <col class="col-5"> 
                            <col class="col-5">
                            <col class="col-10">
                        </colgroup>

                        <thead>
                            <tr>
                                <th>姓名</th>
                                <th>身份证号</th>
                                <th>联系方式</th>
                                <th>来源</th>
                                <th>凭证</th>
                                <th>申诉类型</th>
                                <th>申诉结果</th>
                                <th>申诉时间</th>
                            </tr>
                        </thead>
                        

                        <tbody>
                            <?php foreach ($appeal as $key => $value): ?>
                                <tr>
                                    <td><?=$value['name'] ?>-申诉人</td>
                                    <td><?=$this->unlock($value['idNumber']) ?></td>
                                    <td><?=$value['phone'] ?></td>
                                    <td><?=$value['origin'] ?></td>
                                    <td>
                                        <span style="cursor: pointer;" onclick="createPreviewModal('<?=$value['img'] ?>')" class="voucher blue-color">凭证</span>
                                    </td>
                                    <td><?=$value['type'] == 1 ? '信息识别错误' : '证件重复' ?></td>
                                    <td><?=$value['status'] == 1 ? '有效' : ($value['status'] == 2 ? '驳回' : '待处理') ?></td>
                                    <td><?=$value['create_time'] ?></td>
                                </tr>
                                <?php if ($value['type'] == 0 && $value['status'] == 0): ?>
                                <tr>
                                    <td><?=$value['repeat']['name'] ?></td>
                                    <td><?=$this->unlock($value['repeat']['idNumber']) ?></td>
                                    <td><?=$this->unlock($value['repeat']['phone']) ?></td>
                                    <td><?=$value['repeat']['origin'] ?></td>
                                    <td>
                                        <span style="cursor: pointer;" onclick="createPreviewModal('<?=$value['repeat']['card_img'] ?>')" class="voucher blue-color">凭证</span>
                                    </td>
                                    <td></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <?php endif ?>
                            <?php endforeach ?>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
		<div class="hw-group">
            <div class="group-title">订单信息<span style="float: right;color:#2496EC;margin-right: 25px;"></span></div>
            <div class="main-table-wrap" style="margin-top: 20px;">
                <form id="table-form" method="POST" action="">
                    <table cellspacing="0" cellpadding="0" border="0">  
                        <colgroup>
                            <col class="col-10">
                            <col class="col-5">
                            <col class="col-5">
                            <col class="col-4">
                            <col class="col-10">
                            <col class="col-5">
                            <col class="col-4"> 
                            <col class="col-6">
                        </colgroup>

                        <thead>
                            <tr>
                                <th>订单号</th>
                                <th>入住方式</th>
                                <th>酒店名称</th>
                                <th>房型</th>
                                <th>入住-离店时间</th>
                                <th>订单状态</th>
                                <th>订单金额</th>
                                <th>发票状态</th>
                            </tr>
                        </thead>
                        

                        <tbody>
                            <?php foreach ($list as $key => $value): ?>
                                <tr>
                                    <td>
                                        <a style="" class="blue-color" href="<?=base_url().'Admin/Member/orderDetail/'.urlencode($value['orderNumber']) ?>"><?=$value['orderNumber'] ?></a>
                                    </td>
                                    <td>自助机办理</td>
                                    <td><?=$value['hotel_name'] ?></td>
                                    <td><?=$value['roomType'] ?></td>
                                    <td><?=$value['checkInTime'].'-'.$value['checkOutTime'] ?></td>
                                    <td>
                                    <?php
                                        switch ($value['status']) {
                                            case 'reserved':
                                                echo '预定中';
                                                break;
                                            
                                            case 'checked-in':
                                                echo '已入住';
                                                break;

                                            case 'checked-out':
                                                echo '已退房';
                                                break;

                                            case 'cancelled':
                                                echo '已取消';
                                                break;
                                        }
                                    ?>
                                    </td>
                                    <td><?=$value['total_price'] ?></td>
                                    <?php if ($value['invoice_type'] == 0): ?>
                                        <td>待申请开票</td>
                                    <?php elseif ($value['invoice_type'] == 1): ?>
                                        <td class="blue-color">已申请开票</td>
                                    <?php elseif ($value['invoice_type'] == 2): ?>
                                        <td class="green-color">已同意开票</td>
                                    <?php elseif ($value['invoice_type'] == 3): ?>
                                        <td class="red-color">已拒绝开票</td>
                                    <?php endif ?>
                                </tr>
                            <?php endforeach ?>
                        </tbody>
                    </table>
                </form>
                <?php $this->load->view('Admin/Page/page'); ?>
            </div>
        </div>
		<!-- 表格 -->
        <!-- <div class="modal hide" id="img-modal">
            <div class="modal-mask"></div>
            <div class="modal-content">
                <div class="modal-header">
                    <i class="iconfont" data-dismiss="modal">&#xe63d;</i>
                    <div class="modal-title">图片预览</div>
                </div>
                <div class="modal-body">
                    <img class="preview-img-box" src="">
                </div>
            </div>
        </div> -->
        <div class="hw-btn-group">
            <a class="hw-btn hw-default-btn" style="cursor: pointer;width: 60px;display: block;margin: 30px auto 20px;"  href="<?=base_url().'Admin/Member/memberList' ?>">返回</a>
        </div>
	</div>







	<script src="/static/lib/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="/static/lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="/static/lib/jquery.form.min.js"></script>
    <script type="text/javascript" src="/static/js/common/util.js"></script>
	<script type="text/javascript" src="/static/js/common/upload.js"></script>
	<script type="text/javascript" src="/static/lib/jquery.validate.js"></script>
	<script type="text/javascript" src="/static/lib/messages_zh.js"></script>
	<script type="text/javascript" src="/static/js/common/validateExtend.js"></script>
	<script type="text/javascript" src="/static/js/common/common.js"></script>
    <!-- <script type="text/javascript" src="/static/lib/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="/static/lib/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript" src="/static/lib/ueditor/addCustomizeDialog.js"></script> -->
    <script>
        var imgModal = $('#img-modal');
        function createPreviewModal(url) {
        if(!url||url==''){
            return;
        }
        var str;
		if (imgModal.length > 0) {
			imgModal.find('.modal-body').find('img').attr('src', url);
			imgModal.removeClass('hide');
			return;
		} 

		str = '<div class="modal hide" id="img-modal">'+
				    '<div class="modal-mask"></div>'+
				    '<div class="modal-content">'+
				        '<div class="modal-header">'+
				            '<i class="iconfont" data-dismiss="modal">&#xe63d;</i>'+
				            '<div class="modal-title">图片预览</div>'+
				        '</div>'+
				        '<div class="modal-body">'+
				        	'<img class="preview-img-box" src="'+ url +'">'+
				        '</div>'+ 
				    '</div>'+
				'</div>';
		$('body').append(str);
		setTimeout(function() {
			imgModal = $('#img-modal');
			imgModal.removeClass('hide');
		}, 20);
	}
    </script>
</body>
</html>